import { botAiListData, botListData, dataList2, dataLists, imgData, left_List, navLinks, newDataList, newtuiJianHuatiData, newwenzhangbangLists, tuiJianHuatiData, tuiJianList, wenzhangbangLists, zuozhelist } from '@/util/data';
import axios from 'axios';

axios.interceptors.response.use(response => {
    const { url, method } = response.config;
    if (url === '/api/get-navlinks' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: navLinks.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-datalists' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: dataLists.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-datalist2' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: dataList2.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-imgData' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: imgData.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-left_List' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: left_List.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-newdatalist' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: newDataList.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-botAiListData' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: botAiListData.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-tuiJianList' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: tuiJianList.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-botListData' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: botListData.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-zuozhelist' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: zuozhelist.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-tuiJianHuatiData' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: tuiJianHuatiData.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-wenzhangbangLists' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: wenzhangbangLists.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-newwenzhangbangLists' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: newwenzhangbangLists.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }
    if (url === '/api/get-newtuiJianHuatiData' && method === 'get') {
        return {
            data: {
                code: 0,
                msg: 'success',
                data: newtuiJianHuatiData.value
            },

            status: 200,
            statusText: 'OK',
            headers: response.headers,
            config: response.config,
        };
    }

    return response;
}, error => {
    return Promise.reject(error);
});

export default axios;